home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / WWIV Mods / DONATE.MOD < prev    next >
Encoding:
Text File  |  1993-05-22  |  1.7 KB  |  78 lines

  1. Mod by Gilgamesh #1 @4104 NukeNet
  2. Donate.mod adds donations list similar to the bbs list...
  3.  
  4. Add this case to void mainmenu() in BBS.C
  5.  
  6.   case '$':
  7.     donate();
  8.     break;
  9.  
  10. Add this void to MISCCMND.C
  11.  
  12. void donate()
  13. {
  14.   int i,i1,i2,f,done,ok;
  15.   char s[150],s1[150],s2[150],ch,ch1,*ss;
  16.   char amount[5];
  17.   long l,l1;
  18.  
  19.   done=0;
  20.   printfile("DONATE.MSG");
  21.   do {
  22.     nl();
  23.     prt(2,"Donations [I]:nfo, [L]:ist, [D]:onate, [Q]:uit > ");
  24.     ch=onek("QILD");
  25.     switch(ch) {
  26.       case 'Q':
  27.         done=1;
  28.     break;
  29.       case 'I':
  30.     printfile("DINFO.MSG");
  31.     break;
  32.       case 'L':
  33.     pl("╔══════════════════════════════════════════╗");
  34.     pl("║   Name                            Amount ║");
  35.     pl("╚══════════════════════════════════════════╝");
  36.     printfile("DONATES.MSG");
  37.     break;
  38.       case 'D':
  39.         if ((actsl<=10)) {
  40.           nl();
  41.           nl();
  42.       pl("You must be a validated user to add to the Donations list.");
  43.       nl();
  44.       break;
  45.     }
  46.     nl();
  47.     npr("Hello %s ",thisuser.name);
  48.     nl();
  49.     pl("Enter the amount you wish to donate");
  50.     pl("In the form ##.##");
  51.     outstr(":");
  52.     mpl(5);
  53.     input(amount,5);
  54.     sprintf(s,"%-34s  $%5s\r\n",thisuser.name, amount);
  55.     nl();
  56.     nl();
  57.     pl(s);
  58.     nl();
  59.     prt(5,"Is this correct? ");
  60.     if (yn()) {
  61.       sprintf(s1,"%sDONATES.MSG",syscfg.gfilesdir);
  62.       f=open(s1,O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE);
  63.       if (filelength(f)) {
  64.         lseek(f,-1L,SEEK_END);
  65.         read(f,((void *)&ch1),1);
  66.         if (ch1==26)
  67.         lseek(f,-1L,SEEK_END);
  68.       }
  69.       write(f,(void *)s,strlen(s));
  70.       close(f);
  71.       nl();
  72.       pl("Added to Donations list.");
  73.     }
  74.       break;
  75.     }
  76.   } while ((!done) && (!hangup));
  77. }
  78.